package com.health.tablebean;

import java.util.Date;

import android.text.TextUtils;
import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

/**
 * @author Administrator 个人基本信息_既往史
 * 
 * 
 */
@Table(name = "ARCHIVE_ILLNESSHISTORYINFO")
public class ARCHIVE_ILLNESSHISTORYINFO {

	/** 主键标识 */
	@Id(column = "ID")
	private int ID;
	/** 确诊时间 */
	private Date DIAGNOSETIME;
	/** 既往史－（手术、外伤、输血）名称 */
	private String ILLNESSNAME_OTHER;
	/** 既往史－疾病－其他 */
	private String ILLNESS_OTHER;
	/** 建档编号（与ARCHIVE_BASEINFO表关联） */
	private String ARCHIVEID;
	/** 既往史类型1:疾病,2:手术,3:外伤,4:输血 */
	private String ILLNESSTYPE;
	/***
	 **/
	private String ILLNESSNAME;
	/** 恶性肿瘤名称 */
	private String THERIOMA;
	/** 职业病 */
	private String JOBILLNESS;
	private String IDCARD;
	private String NGUID;

	public String getNGUID() {
		return NGUID;
	}

	public void setNGUID(String nGUID) {
		NGUID = nGUID;
	}

	public String getIDCARD() {
		return IDCARD;
	}

	public void setIDCARD(String iDCARD) {
		IDCARD = iDCARD;
	}

	public String getJOBILLNESS() {
		return JOBILLNESS;
	}

	public void setJOBILLNESS(String jOBILLNESS) {
		JOBILLNESS = jOBILLNESS;
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public Date getDIAGNOSETIME() {
		return DIAGNOSETIME;
	}

	public void setDIAGNOSETIME(Date dIAGNOSETIME) {
		DIAGNOSETIME = dIAGNOSETIME;
	}

	public String getILLNESSNAME_OTHER() {
		return ILLNESSNAME_OTHER;
	}

	public void setILLNESSNAME_OTHER(String iLLNESSNAME_OTHER) {
		ILLNESSNAME_OTHER = iLLNESSNAME_OTHER;
	}

	public String getILLNESS_OTHER() {
		return ILLNESS_OTHER;
	}

	public void setILLNESS_OTHER(String iLLNESS_OTHER) {
		ILLNESS_OTHER = iLLNESS_OTHER;
	}

	public String getARCHIVEID() {
		return ARCHIVEID;
	}

	public void setARCHIVEID(String aRCHIVEID) {
		ARCHIVEID = aRCHIVEID;
	}

	public String getILLNESSTYPE() {
		return ILLNESSTYPE;
	}

	public void setILLNESSTYPE(String iLLNESSTYPE) {
		ILLNESSTYPE = iLLNESSTYPE;
	}

	public String getILLNESSNAME() {
		return ILLNESSNAME;
	}

	public void setILLNESSNAME(String iLLNESSNAME) {
		ILLNESSNAME = iLLNESSNAME;
	}

	public String getTHERIOMA() {
		return THERIOMA;
	}

	public void setTHERIOMA(String tHERIOMA) {
		THERIOMA = tHERIOMA;
	}

	// private String JOBILLNESS;
	// /** 主键标识 */
	// @Id(column="ID") private String ID;
	// /** 确诊时间 */private Date DIAGNOSETIME;
	// /** 既往史－（手术、外伤、输血）名称 */private String ILLNESSNAME_OTHER;
	// /** 既往史－疾病－其他 */private String ILLNESS_OTHER;
	// /** 建档编号（与ARCHIVE_BASEINFO表关联） */private String ARCHIVEID;
	// /** 既往史类型1:疾病,2:手术,3:外伤,4:输血 */private String ILLNESSTYPE;
	// /** */private String ILLNESSNAME;
	// /** 恶性肿瘤名称 */
	// private String THERIOMA;
	//
	// private String IDCARD;
	// private UUID NGUID;

	@Override
	public boolean equals(Object o) {
		if (!(o instanceof ARCHIVE_ILLNESSHISTORYINFO)) {
			return false;
		}
		ARCHIVE_ILLNESSHISTORYINFO obj = (ARCHIVE_ILLNESSHISTORYINFO) o;

		Date dia = notNull(getDIAGNOSETIME());
		String illOther = notNull(getILLNESS_OTHER());
		String illnameOther = notNull(getILLNESSNAME_OTHER());
		String illType = notNull(getILLNESSTYPE());
		String illName = notNull(getILLNESSNAME());
		String therioma = notNull(getTHERIOMA());
		String idcard = notNull(getIDCARD());

		Date odia = notNull(obj.getDIAGNOSETIME());
		String oillOther = notNull(obj.getILLNESS_OTHER());
		String oillnameOther = notNull(obj.getILLNESSNAME_OTHER());
		String oillType = notNull(obj.getILLNESSTYPE());
		String oillName = notNull(obj.getILLNESSNAME());
		String otherioma = notNull(obj.getTHERIOMA());
		String oidcard = notNull(obj.getIDCARD());

		if (dia.equals(odia) && illOther.equals(oillOther) && illnameOther.equals(oillnameOther)
				&& illType.equals(oillType) && illName.equals(oillName) && therioma.equals(otherioma)
				&& idcard.equals(oidcard)) {
			return true;
		}
		return false;
	}

	private String notNull(String str) {
		if (TextUtils.isEmpty(str)) {
			return "";
		}
		return str;
	}

	private String notNull(int str) {
		if (str == 0) {
			return "0";
		}
		return String.valueOf(str);
	}

	private Date notNull(Date date) {
		if (date == null) {
			return new Date();
		}
		return date;
	}

	@Override
	public String toString() {
		return "ARCHIVE_ILLNESSHISTORYINFO [ID=" + ID + ", DIAGNOSETIME=" + DIAGNOSETIME + ", ILLNESSNAME_OTHER="
				+ ILLNESSNAME_OTHER + ", ILLNESS_OTHER=" + ILLNESS_OTHER + ", ARCHIVEID=" + ARCHIVEID + ", ILLNESSTYPE="
				+ ILLNESSTYPE + ", ILLNESSNAME=" + ILLNESSNAME + ", THERIOMA=" + THERIOMA + ", JOBILLNESS=" + JOBILLNESS
				+ ", IDCARD=" + IDCARD + ", NGUID=" + NGUID + "]";
	}

}
